package com.dtw.ditouwang.ui.mine

import android.os.Bundle
import android.support.v7.widget.RecyclerView
import android.text.Html
import android.widget.Adapter
import com.dtw.ditouwang.R
import com.dtw.ditouwang.beans.HelpContentBean
import com.dtw.ditouwang.ui.BaseActivity
import kotlinx.android.synthetic.main.activity_help_content.*
import retrofit2.Call
import retrofit2.Callback
import retrofit2.Response

class HelpContentActivity: BaseActivity(){
    companion object {
        var KeyHelpConentID="KeyHelpConentID"
    }
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_help_content)
        webApi.getHelpContent(intent.getStringExtra(KeyHelpConentID)).enqueue(object :Callback<HelpContentBean>{
            override fun onFailure(call: Call<HelpContentBean>, t: Throwable) {
            }

            override fun onResponse(call: Call<HelpContentBean>, response: Response<HelpContentBean>) {
                var helpContentBean=response.body()
                contentText.text=Html.fromHtml(Html.fromHtml(helpContentBean?.data?.get(0)?.content).toString())
                setTitle(helpContentBean?.data?.get(0)?.title)
            }
        })
    }
}